let trs = document.querySelector('tbody').querySelectorAll('tr');
for (let i = 0; i < trs.length; i++) {
    trs[i].onmouseover = function () {
        this.className = 'bg';
    }
    trs[i].onmouseout = function () {
        this.className = null;
    }
}